import request from '@/utils/request'
import axios from 'axios'

// 人口分布-设定参数-图件模板
export function getTypeNameByType(type) {
  return request({
    url: `/map/getTypeNameByType/${type}`,
    method: 'get'
  })
}

// 人口分布-设定参数-评估
export function populationDistribution(data, cancel) {
  return request({
    url: `/fxfzaqbz/data/populationDistribution`,
    method: 'post',
    data,
    cancelToken: new axios.CancelToken(function executor(c) {
      cancel.c = c;
    })
  })
}

// 人员伤亡及紧急安置-设定参数-评估 
export function alg(data) {
  return request({
    url: `/fxfzaqbz/DestoryRate/alg`,
    method: 'post',
    data
  })
}

// 人员伤亡及紧急安置-结果查看-出图
export function HumanCasualtiesAndPlacement(data, cancel) {
  return request({
    url: `/fxfzaqbz/data/HumanCasualtiesAndPlacement`,
    method: 'post',
    data,
    cancelToken: new axios.CancelToken(function executor(c) {
      cancel.c = c;
    })
  })
}

 
// 人员伤亡及紧急安置-结果查看-确定
export function saveUrgencysettleDataByPG(data, type) {
  let url;
  if(type == '2'){
    url = '/fxfzaqbz/data/saveUrgencysettleDataByPG'
  }else {
    url = '/fxfzaqbz/data/saveCasualties'
  }
  return request({
    url,
    method: 'post',
    data
  })
}
